package sreal.controller;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;

/**
 * Copyright 2000-2099 by Koudai Corporation.
 * <p/>
 * All rights reserved.
 * <p/>
 * This software is the confidential and proprietary information of
 * Koudai Corporation ("Confidential Information"). You
 * shall not disclose such Confidential Information and shall use
 * it only in accordance with the terms of the license agreement
 * you entered into with Koudai.
 *
 * @author zhoupan@weidian.com
 * @since 15/9/20.
 * <p/>
 * <p>文件描述：</p>
 */

@Controller
public class TestController {

    private static final Logger LOGGER = LoggerFactory.getLogger(TestController.class);

    // 定义页面变量
    @Value("json")
    private String viewName;

    @RequestMapping(value = {"test.do"})
    public String test(Model model, @RequestParam(value = "var1", required = true) String var1) {
        model.addAttribute("result", "param: " + var1 + " \nspring mvc 3.x + dubbo + mybatis + logback sreal works!!!");
        LOGGER.info("logback framework works!!!");
        return viewName;
    }

}
